Socket
Socket
Sign inDemoInstall

async-limiter

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-limiter

asynchronous function queue with adjustable concurrency


Version published
Weekly downloads
8.2M
decreased by-1.04%
Maintainers
1
Weekly downloads
 
Created

What is async-limiter?

The async-limiter package is a module that allows you to limit the number of asynchronous operations that are being processed at the same time. This is useful for controlling resource usage and managing load under high-concurrency situations.

What are async-limiter's main functionalities?

Concurrency Limiting

This code sample demonstrates how to use async-limiter to limit the number of concurrent asynchronous tasks. In this example, the concurrency limit is set to 2, meaning only two tasks will be processed at a time.

const Limiter = require('async-limiter');

const t = new Limiter({ concurrency: 2 });

for (let i = 0; i < 10; i++) {
  t.push((cb) => {
    setTimeout(() => {
      console.log('Processed task', i);
      cb();
    }, 100);
  });
}

t.onDone(() => {
  console.log('All tasks processed');
});

Other packages similar to async-limiter

Keywords

FAQs

Package last updated on 02 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc